package com.xiaoyu.merchant.ui.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;

import com.xiaoyu.merchant.R;

public class WaitAuditDialog extends Dialog  {

    private Context mContext;
    private View mContentView;
    private boolean iscancelable;//控制点击dialog外部是否dismiss
    private boolean isBackCancelable;//控制物理返回键是否dismiss

    public WaitAuditDialog(@NonNull Context context, boolean isCancelable, boolean isBackCancelable) {
        super(context, R.style.BaseDialogStyle);
        this.iscancelable = isCancelable;
        this.isBackCancelable = isBackCancelable;
        this.mContext = context;
    }
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initView();
    }

    private void initView() {
        mContentView = LayoutInflater.from(mContext).inflate(R.layout.wait_audit_dialog, null);
        mContentView.setClickable(false);
        setCancelable(iscancelable);//点击外部不可dismiss
        setCanceledOnTouchOutside(isBackCancelable);
        setContentView(mContentView);
    }

}
